FROM frolvlad/alpine-java:jdk8-slim

ADD /ruoyi-admin/target/ruoyi-admin.jar ruoyi-admin.jar
#RUN bash -c 'touch /app.jar'
EXPOSE 8080

#增加时区设置
ENV TZ=Asia/Shanghai
#支持utf-8编码

#ENV LC_ALL zh_CN.UTF-8
#ENV LANG zh_CN.UTF-8

#设置环境变量
#ENV LC_ALL en_US.utf8



ENV JAVA_OPTS="\
-server \
-Xmx1g \
-Xms1g \
-Xmn512m \
-XX:MetaspaceSize=256m \
-XX:MaxMetaspaceSize=512m \
-XX:+UseParallelGC \
-XX:ParallelGCThreads=4 \
-XX:+UseParallelOldGC \
-XX:+UseAdaptiveSizePolicy \
-XX:+PrintGCDetails \
-XX:+PrintTenuringDistribution \
-XX:+PrintGCTimeStamps \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=/tmp/document_server.dump \
-Xloggc:/gc.log \
-XX:+UseGCLogFileRotation \
-XX:NumberOfGCLogFiles=5 \
-XX:GCLogFileSize=10M"


RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

#ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","-Dspring.profiles.active=${SPRING_PROFILES_ACTIVE}","/account-service.jar"]



ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ruoyi-admin.jar